<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>递接</title>
</head>
<body>
<script>
    function x(n){
        if (n === 1){
            return 1;
        }else {
            return n * x( n - 1);
        }

    }
    console.log(x(5));
    //5*(5-1)=20
    console.log(x(6));
    //6*20=120
    console.log(x(7));
    //7*120=5040
    console.log(x(8));
    //8*5040=40320
    console.log(x(9));
    //9*40320=362880
</script>
</body>
</html>